package com.example;

import com.example.bean.CartoonCatAndMouse;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.*;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Indexed;
@SpringBootApplication(excludeName = "o rg.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration")
    //@SpringBootConfiguration
        //@Configuration
    //        Component
        //@Indexed
//    @EnableAutoConfiguration
//        @AutoConfigurationPackage
//            @Import(AutoConfigurationPackages.Registrar.class)  ?:设置当前配置所在的包作为扫描包，后续要扫描该包
//        @Import(AutoConfigurationImportSelector.class)    ？aware功能 order 定义bean加载顺序功能
//    @ComponentScan(excludeFilters = { @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
//            @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class) })

//@Import(CartoonCatAndMouse.class)
public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class);
        CartoonCatAndMouse bean = applicationContext.getBean(CartoonCatAndMouse.class);
        bean.play();
    }
}
